package personal.gavin.utils
{
	public class DateUtil
	{
		/**
		 * convert twitter time to flex time
		 */
		public static function timeStringToDate (date_str:String):Date {
			var flex_time:String;
			var str_array:Array;
			if (date_str.indexOf("+") >= 0){
				str_array = date_str.split("+");
				flex_time = str_array[0] + "GMT+" + str_array[1];
			} else {
				str_array = date_str.split("-");
				flex_time = str_array[0] + "GMT-" + str_array[1];
			}
			var result:Date = new Date();
			result.setTime(Date.parse(flex_time));
			return result;
		}
	}
}